package com.binance.binancedemo.entity;

import java.math.BigDecimal;

/**
 * Created by xiangchong on 2017/12/15.
 */



public class Ticker {

    public String symbol;
    public BigDecimal priceChange;
    public BigDecimal priceChangePercent;
    public BigDecimal weightedAvgPrice;
    public BigDecimal prevClosePrice;
    public BigDecimal lastPrice;
    public BigDecimal lastQty;
    public BigDecimal bidPrice;
    public BigDecimal bidQty;
    public BigDecimal askPrice;
    public BigDecimal openPrice;
    public BigDecimal highPrice;
    public BigDecimal lowPrice;
    public BigDecimal volume;
    public BigDecimal quoteVolume;
    public Long openTime;
    public Long closeTime;
    public Long firstId;
    public Long lastId;
    public Long count;
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Ticker ticker = (Ticker) o;

        if (symbol != null ? !symbol.equals(ticker.symbol) : ticker.symbol != null) return false;
        if (priceChange != null ? !priceChange.equals(ticker.priceChange) : ticker.priceChange != null)
            return false;
        if (priceChangePercent != null ? !priceChangePercent.equals(ticker.priceChangePercent) : ticker.priceChangePercent != null)
            return false;
        if (weightedAvgPrice != null ? !weightedAvgPrice.equals(ticker.weightedAvgPrice) : ticker.weightedAvgPrice != null)
            return false;
        if (prevClosePrice != null ? !prevClosePrice.equals(ticker.prevClosePrice) : ticker.prevClosePrice != null)
            return false;
        if (lastPrice != null ? !lastPrice.equals(ticker.lastPrice) : ticker.lastPrice != null)
            return false;
        if (lastQty != null ? !lastQty.equals(ticker.lastQty) : ticker.lastQty != null)
            return false;
        if (bidPrice != null ? !bidPrice.equals(ticker.bidPrice) : ticker.bidPrice != null)
            return false;
        if (bidQty != null ? !bidQty.equals(ticker.bidQty) : ticker.bidQty != null) return false;
        if (askPrice != null ? !askPrice.equals(ticker.askPrice) : ticker.askPrice != null)
            return false;
        if (openPrice != null ? !openPrice.equals(ticker.openPrice) : ticker.openPrice != null)
            return false;
        if (highPrice != null ? !highPrice.equals(ticker.highPrice) : ticker.highPrice != null)
            return false;
        if (lowPrice != null ? !lowPrice.equals(ticker.lowPrice) : ticker.lowPrice != null)
            return false;
        if (volume != null ? !volume.equals(ticker.volume) : ticker.volume != null) return false;
        if (quoteVolume != null ? !quoteVolume.equals(ticker.quoteVolume) : ticker.quoteVolume != null)
            return false;
        if (openTime != null ? !openTime.equals(ticker.openTime) : ticker.openTime != null)
            return false;
        if (closeTime != null ? !closeTime.equals(ticker.closeTime) : ticker.closeTime != null)
            return false;
        if (firstId != null ? !firstId.equals(ticker.firstId) : ticker.firstId != null)
            return false;
        if (lastId != null ? !lastId.equals(ticker.lastId) : ticker.lastId != null) return false;
        return count != null ? count.equals(ticker.count) : ticker.count == null;
    }

    @Override
    public int hashCode() {
        int result = symbol != null ? symbol.hashCode() : 0;
        result = 31 * result + (priceChange != null ? priceChange.hashCode() : 0);
        result = 31 * result + (priceChangePercent != null ? priceChangePercent.hashCode() : 0);
        result = 31 * result + (weightedAvgPrice != null ? weightedAvgPrice.hashCode() : 0);
        result = 31 * result + (prevClosePrice != null ? prevClosePrice.hashCode() : 0);
        result = 31 * result + (lastPrice != null ? lastPrice.hashCode() : 0);
        result = 31 * result + (lastQty != null ? lastQty.hashCode() : 0);
        result = 31 * result + (bidPrice != null ? bidPrice.hashCode() : 0);
        result = 31 * result + (bidQty != null ? bidQty.hashCode() : 0);
        result = 31 * result + (askPrice != null ? askPrice.hashCode() : 0);
        result = 31 * result + (openPrice != null ? openPrice.hashCode() : 0);
        result = 31 * result + (highPrice != null ? highPrice.hashCode() : 0);
        result = 31 * result + (lowPrice != null ? lowPrice.hashCode() : 0);
        result = 31 * result + (volume != null ? volume.hashCode() : 0);
        result = 31 * result + (quoteVolume != null ? quoteVolume.hashCode() : 0);
        result = 31 * result + (openTime != null ? openTime.hashCode() : 0);
        result = 31 * result + (closeTime != null ? closeTime.hashCode() : 0);
        result = 31 * result + (firstId != null ? firstId.hashCode() : 0);
        result = 31 * result + (lastId != null ? lastId.hashCode() : 0);
        result = 31 * result + (count != null ? count.hashCode() : 0);
        return result;
    }
}
